<!--  -->
<template>
  <div class="landing-footer" :class="{'landing-footer-change': changeStyle}">
      <p>&copy;{{(new Date).getFullYear()}} bitahub.com 版权所有 | 皖ICP备18012113号-1</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      screenWidth: document.body.clientWidth,
      changeStyle: false
    }
  },

  components: {},

  watch: {
    screenWidth (val) {
      if (!this.timer) {
        this.screenWidth = val
        this.timer = true
        let that = this
        setTimeout(function () {
          that.init(that.screenWidth)
          that.timer = false
        }, 400)
      }
    }
  },

  computed: {},

  mounted () {
    this.init(this.screenWidth)
    const that = this
    this.clientWidth = `${document.documentElement.clientWidth}`
    window.onresize = () => {
      return (() => {
        window.screenWidth = document.body.clientWidth
        that.screenWidth = window.screenWidth
      })()
    }
  },

  methods: {
    init (screenWidth) {
      if (screenWidth <= 1400) {
        this.changeStyle = true
      } else {
        this.changeStyle = false
      }
    }
  }
}

</script>
<style lang="stylus">
.landing-footer
    background #376a8f
    width 100%
    height 177px
    >p
        font-size 14px
        line-height 24px
        padding 77px 0 76px
        text-align center
        width 1200px
        margin 0 auto 0
        color #9C9EA0
.landing-footer-change
    >p
        width 800px
</style>
